#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@File ：CartParser.py
@Author ：zqy
@Email : zqingy@work@163.com 
@note: 
"""
from application.Parser import BaseValidator, JSONRequestParser


class CartValidator(BaseValidator):

    @classmethod
    def post(cls) -> JSONRequestParser:
        p = JSONRequestParser(trim=True)
        p.add_argument_required_non_null("product_id", type=int, help="产品ID")
        p.add_argument_required_non_null("quantity", type=int, help="数量")
        return p

    @classmethod
    def put(cls) -> JSONRequestParser:
        p = JSONRequestParser(trim=True)
        p.add_argument_required_non_null("quantity", type=int, help="数量")
        return p